/**
 * 
 */
package sa.edu.kaust.msc.cloud.mgmt.sim.domain;

import java.util.ArrayList;
import java.util.List;

import org.cloudbus.cloudsim.Pe;
import org.cloudbus.cloudsim.provisioners.PeProvisionerSimple;

import sa.edu.kaust.msc.cloud.mgmt.sim.exceptions.OutOfRangeCoreExeption;

/**
 * @author suzan
 *
 */
public class Cores {
	
	private int mips = 1000;
	
	
	public List<Pe> generateCore(final int coreNum) throws OutOfRangeCoreExeption{
		List<Pe> peList = new ArrayList<Pe>();
		
		int _iCore = coreNum -1;
		if(_iCore < 0)
			throw new OutOfRangeCoreExeption("Server must have at least 1 Core");
		
		for(int i = 0; i < _iCore; i++){
			peList.add(new Pe(i, new PeProvisionerSimple(mips))); // need to store Pe id and MIPS Rating
		}
		
		return peList;
	}

}
